package com.dis.consumer;

import com.dis.entity.BaseData;
import com.lmax.disruptor.WorkHandler;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.atomic.AtomicInteger;

@Slf4j
public class TranforMonitoringDataConsumer implements WorkHandler<BaseData> {

    private String consumerId;
    private static AtomicInteger count = new AtomicInteger(0);

    public TranforMonitoringDataConsumer(String consumerId){
        this.consumerId = consumerId;
    }

    public void onEvent(BaseData event) throws Exception {
        //todo 将数据接收过来的消息转换成实时数据的形式，存入BaseData
        log.info("消费者 {}，拿到消息，将其转换成事实数据信息",consumerId);
        count.incrementAndGet();
    }
}
